package org.adream.dreamnt;

import org.jasig.cas.util.AbstractCipherExecutor;
import org.jasig.cas.util.BaseStringCipherExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component("noOpByteCipherExecutor")

public final class NoOpBCipherExecutor extends AbstractCipherExecutor<byte[], byte[]> {
	private static final Logger LOGGER = LoggerFactory.getLogger(NoOpBCipherExecutor.class);

	/**
	 * Instantiates a new No-Op cipher executor. Issues a warning on safety.
	 */
	public NoOpBCipherExecutor() {
		super(NoOpBCipherExecutor.class.getName());
		LOGGER.warn(
				"[{}] does no encryption and may NOT be safe in a production environment. "
						+ "Consider using other choices, such as [{}] that handle encryption, signing and verification of "
						+ "all appropriate values.",
				this.getClass().getName(), BaseStringCipherExecutor.class.getName());
	}

	@Override
	public byte[] encode(final byte[] value) {
		return value;
	}

	@Override
	public byte[] decode(final byte[] value) {
		return value;
	}
}
